import * as OpenCC from 'opencc-js';

const customDictS2T = [
  ['台', '臺'],
];
const customDictT2S = [
  ['臺', '台']
]
const converterS2T = OpenCC.ConverterFactory(
  OpenCC.Locale.from.cn,                   // 中國大陸 => OpenCC 標準
  OpenCC.Locale.to.hk, // OpenCC 標準 => 臺灣+自訂
  [customDictS2T]
);
const converterT2S = OpenCC.ConverterFactory(
  OpenCC.Locale.from.hk,
  OpenCC.Locale.to.cn,
  [customDictT2S]
);

export {
  converterS2T,
  converterT2S
}